<template>
  <div class="card-edit-more-box" @click="Click2Esc($event)">
    <div class="card-edit-more-box-content">
      <el-row class="set-tab">
        <el-col class="set-tab-btns" :span="22">
          <el-button class="set-tab-item"
            :class="tabType=='TOOLBAR'?'is-tab-active':''"
            @click.stop="click2Tab('TOOLBAR')">底导</el-button>
          <!-- <el-button class="set-tab-item"
            :class="tabType=='MORE'?'is-tab-active':''"
            @click.stop="click2Tab('MORE')">更多功能</el-button> -->
        </el-col>

        <el-col class="set-tab-close" :span="2">
          <el-icon @click.stop="click2Close"><close /></el-icon>
        </el-col>
      </el-row>

      <div class="set-box">
        <CardEditToolbar v-if="tabType=='TOOLBAR'"></CardEditToolbar>
      </div>
    </div>
  </div>
</template>

<script>
  import CardEditToolbar from '@/views/card/more/toolbar/CardEditToolbar.vue';
  export default {
    data() {
      return {
        tabType: 'TOOLBAR',  // TOOLBAR MORE
      }
    },
    components: {
      CardEditToolbar,
    },
    methods: {
      Click2Esc(e) {
        if(e.target == e.currentTarget) this.$emit('close');
      },
      click2Close() {
        this.$emit('close');
      },
      click2Tab(type) {
        this.tabType = type;
      },
    },
  }
</script>

<style lang="scss">
  .card-edit-more-box {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    // background: rgba(255,255,255,0.8);

    .card-edit-more-box-content {
      position: relative;
      margin: 0 auto;
      padding: 0;
      min-width: 910px;
      max-width: 1000px;
      width: 80%;
      height: 570px;
      top: 50%;
      transform: translate(-50px, -50%);
      background: #fff;
      // border: 1px solid #EBEEF5;
      border-radius: 4px;
      box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);

      .set-tab {
        position: relative;
        width: 100%;
        height: 53px;
        background: #43475C;
        border-radius: 2px 2px 0px 0px;
        overflow: hidden;

        .set-tab-btns{
          position: relative;
          height: 100%;

          .set-tab-item{
            width: 121px;
            height: 100%;
            font-size: 16px;
            color: #fff;
            background-color: transparent;
            background-image: none;
            margin: 0;
            border: none;
            border-radius: 0;
            transition: background-color .1s ease-in-out;
          }

          .is-tab-active{
            background-color: #127BFF !important;
          }
        }

        .set-tab-close{
          position: relative;
          height: 100%;
          display: flex;
          justify-content: center;
          align-items: center;

          i{
            font-size: 25px;
            color: #fff;
            cursor: pointer;
          }
        }
      }

      .set-box{
        position: relative;
        width: 100%;
        height: calc( 100% - 53px )
        // min-height: 520px;
      }
    }
  }
</style>
